import NoteService from './NoteComponent.service';
export default {
    name: "NoteComponent",
    data() {
      return {
        a: 0,
        note: "",
        date: "",
        isShow: false,
        notes: [],
      }
    },
    methods: {
      showNodeInfo(data) {
        this.note = data.main;
        this.date = data.date;
        this.isShow = true;
      },
      closeModule() {
        this.isShow = false;
      }
    },
    filters: {
        transformDate: function (value) {
            let date = new Date(value);
            let y = 1900 + date.getYear();
            let m = "0" + (date.getMonth() + 1);
            let d = "0" + date.getDate();
            return y + "." 
            + m.substring(m.length - 2, m.length) + "." 
            + d.substring(d.length - 2, d.length) + " "
        }
    },
    mounted() {
        NoteService.search(1,10)
        .then((res) => {
            this.notes = res.data.list;
            console.log(this.notes);
        })
    },
  };